import React, {Component} from 'react';
import {get} from "../../../../netWork";
import {getToken} from "../../../../utiles/token";
import HouseItem from "../../../../components/HoustItem/HouseItem";
import NavHeader from "../../../../components/NavHeader/NavHeader";
class MyCollected extends Component {
    state = {
        houseCollect:[]
    }
    componentDidMount() {
        const token = getToken();
        get({
            url:'/user/favorites',
            headers:{authorization:token }
        }).then(res =>{
            this.setState({houseCollect:res.body})
        })
    }

    render() {
        return (
            <div>
                <NavHeader>我的收藏</NavHeader>
                <HouseItem houseList={this.state.houseCollect}/>
            </div>
        );
    }
}

export default MyCollected;
